#include<disp_manager.h>
#include <stdio.h>
#include <string.h>


static PFontOpr ptFontHead = NULL;
static PFontOpr ptDefaultFontOpr = NULL;

void RegisterFontOpr(PFontOpr ptFontOpr)
{
	ptFontOpr->ptNext = ptFontHead;
	ptFontHead = ptFontOpr;
}

void FontSymstemRegister(void)
{
	extern void FreeTypeRegister(void);
	FreeTypeRegister();
}

int SelectAndInitFont(char *aFontOprName, char *aFontFileName)
{
	PFontOpr pTemp = ptFontHead;
	while(pTemp)
	{
		if(strcmp(aFontOprName,pTemp->name) == 0)
		{
			ptDefaultFontOpr = pTemp;
			return ptDefaultFontOpr->FontInit(aFontFileName);
		}
		pTemp = pTemp->ptNext;
	}
	return -1;
}

int SetFontSize(int iFontSize)
{
	return ptDefaultFontOpr->SetFontSize(iFontSize);
}


int GetFontBitMap(unsigned int dwCode, PFontBitMap ptFontBitMap)
{
	return ptDefaultFontOpr->GetFontBitMap(dwCode, ptFontBitMap);
}

int GetStringRegionCar(char* str, PRegionCartesian ptRegionCar)
{
	ptDefaultFontOpr->GetStringRegionCar(str,ptRegionCar);
	return 0;
}



